Hey, I have a table called products that has a relationship with itself. This table stores products, their sub-products, and then sub-sub-products. When a user searches for the top-most product, this query is supposed to return the parent, its children, and its children's children. Now, my query works, but I am new to the entity framewor...
Hi All,
I want to Test my code! A noble goal I'm sure you agree.
I need to mock out DataContexts for my Regression tests, running the test will verify that for any code change, given the same input we produce the same output.
I'm using Moles to mock out my data contexts. It's awesome and simple, I recommend it, I might move to Moq if ...
I have a database design that's normalized well enough, but now I need to add a new table (entity, since I'm actually using Core Data) and I'm running into some issues.
Landscape has many Assessment
Assessment has one AssessmentType
AssessmentTree has one Assessment
AssessmentTree has one each of 12 other entities, omitted for space.
...
A supply farm can have a transportation document. If present it can be one of two types: internal or external. Both documents share some common data, but have different specialized fields.
I though of modeling this in a OO-ish fashion like this:
In the document table, one of the two doc_*_id is null, the other is the foreign key with...
I am probably going to get slaughtered for this, and told to read the manual (which I have, but it has not helped my understanding).
I working with MySQL more and more at the moment, but I cannot get my head around joins, I know there are multiple types of join, i.e Inner, Outer, Left, Right but I do not what the differences are between...
I've recently refactored my application with the following:
Linq to SQL db connection
Objects to wrap the linq to sql classes
Mappers to map back and forth between objects and Linq to Sql entitys
Service layer to call the repository, handing up objects to the UI.
Before I was just using Linq to SQL objects in my UI (I know). But when d...
Hi I am doing an assignment on ER modelling and there is a part that I'm stuck on, here is an extract:
Patient is a person who is either admitted to the hospital or is registered in an outpatient program. Each patient has a patient number (ID), name, dob, and tele. Resident patients have a Date Admitted. Each outpatient is scheduled for...
This seems to work, but is this the proper way for an entity to have a child set of the same entities?
<hibernate-mapping>
<class name="com.example.Person" table="Person">
<id name="id" column="Id" type="int"><generator class="native"/></id>
<many-to-one name="childOf" class="com.example.Person" column="Child_of_Id"/...
I´m trying to understand some EER-models and I can't figure out what the difference between a normal circle/square/diamon and a double circle/square/diamond is.
What is the original writer trying to tell me?
...
I'm having a huge problem in modeling this problem. I'm writing a exam taking application (in MS-Access, but this isn't really relevant) and there are a few reports that need to be sent out.
The first report is sent out automatically after a person completes an exam. The second report is sent out every 2 weeks (or whatever they want to ...
I have a model: Customer - Address. Customer inherits from Person (if this is important). So, the idea here is that there should be a nullable FK from Customer to Address. Is it at all possible? I am wondering because if the relationship is 1-1 then I can get the FK to Customer table. Yet if I change the multiplicity of address to 0..1 t...
Hi there,
I've got two entities
ServiceDownload.java
@Entity
public class ServiceDownload implements Serializable {
private static final long serialVersionUID = -5336424090042137820L;
@Id
@GeneratedValue
private Long id;
@Length(max = 255)
private String description;
private byte[] download;
private String fileName;
@ManyToOne...
I'm trying to find a tool where a lot of people can work on a data model collaboratively (doesn't have to be at the same time, a checkout mechanism can work too). Embarcadero has an ER application called ER/studio which apparently comes with a repository system that acts like typical version control software. That sounds great except ER/...
I m able to get values using JPA when i have only mapped one table
Now when i have gone for mapping related tables i get the error
Only one may be defined as writable, all others must be specified read-only.
Mapping: org.eclipse.persistence.mappings.OneToOneMapping[userId1]
I m using [EclipseLink-0] (Eclipse Persistence Services...
Hi All, I have a entity model and on it i have a object with name Person that this object
have 1 ti 1 relation with NaturalPerson and LegalPerson.
therefore the Person is a abstract class and Naturalperson and LegalPerson inherited from Person, but when i try to add NaturalPerson in DAL i got this error
A referential integrity constrain...
Using Oracle, is there any way I can execute a query to determine what relationship a specific table has with any other tables in my database? I'm fiddling with the all_constraints table as of now.
...
My domain thus far looks like:
~.domain.RenderJob
~.domain.RenderLayer
~.domain.ImageLayer extends ~.domain.RenderLayer
~.domain.ColorLayer extends ~.domain.RenderLayer
I'd like to add a set field to RenderJob named 'layers'. Elements in the set can be either of type ImageLayer or ColorLayer, both of which extend RenderLayer. Is there...
I'm using the entity framework
My customer class has an AccountID property that includes account information from other tables (such as address and specific account info) by loading the other tables into the property based on their relationships.
like this:
tblAccount acct = new tblAccount();
tblCust cust;
tblAddress addr;
public Cus...
I'm working on a database schema that's driving me a little mad at the moment because I seem to be repeating the same tables to reproduce behaviour for different types.
Basically the system consists of live sensors that are monitored over a network, and loggers that are collected via a handset. The sensors and loggers are divided up in...
Hi.
Consider this very small contrived subset of my schema:
SensorType1
ID : PK
SensorType2
ID : PK
Reading
Timestamp
Value
SensorType1_ID FK -> SensorType1
SensorType2_ID FK -> SensorType2
Some readings are for SensorType1, some are for SensorType2. I would probably add a constraint to ensure exclusively one of those FK's is alway...