eav

Entity Framework - Detaching and Re-attaching entities?

I have Entity-Attribute-Value (EAV) database. Entity in this sense has nothing to do with entities in EF but merely refers to some "thing" about which you are storing information. You store a value in the Value table, which is associated with an Attribute (the name of the information) and an Entity. In the EAV model, you don't store NUL...

Where can I find SQL statements to create EAV model?

Alternatively, anyone know of where I can get the EAV model for Erwin? ...

How to construct a repository Entity having an array of parts

I have a product entity which has several classes (each product type has different fields with thousands of product types). One product class could be a hammer which would have fields of "handle length", "head weight", etc. Another could be a chair with fields of "cushion material", "box spring", etc. Customers add fields based on the...

SQL flattening & dynamic query question

Firstly, I am not certain this is the best way to handle this AT ALL ... totally open to alternative solutions. Secondly, I feel like I'm missing the obvious ... but I'm still missing it so not to proud to ask! UPDATE: .NET 3.5 environment w/ SQL 2005, so things like dynamic linq possible, although I always tend to think of dynamic (bu...

Approach to generic database design

An application that I'm facing at a customer, looks like this: it allows end users to enter "materials". To those materials, they can append any number of "properties". Properties can have a any value of type: decimal, int, dateTime and varchar (length varying from 5 characters to large chunks of text), Essentially, the Schema looks...

Magento - Retrieve products with a specific attribute value

In my block code I am trying to programatically retrieve a list of products that have a attribute with a specific value. Alternately if that is not possible how would one retrieve all products then filter them to just list the products with a specific attribute? ...

EAV over SQL Server

I'm interested in playing around with the EAV model over an SQL Server Database. Is anybody able to point me to an article or framework for an existing model/schema (I'm not intrested in Saas for this)? ...

Best way to store muti-type field

Let's say we have a field that can be in more than one type, for instance: string or date or XML datatypes. Now we have two methods to store this in a database 1- using a string typed field + field defining type: losing "type-aware" sorting capabilities, needs casting 2- separate tables (StringValues,DateValues,Decimal,XML ...etc):a f...

EAV Alternative to User Defined Fields?

Given that users must be able to define their own fields on an object, and define allowed values for these fields - on the fly (no compile) - how would you solve this without using EAV? Example: All objects need one or more reference to the 123 statusnumber (1.a or 2.b or 3.c allowed). ...

SQL Server, where field is int?

how can I accomplish: select * from table where column_value is int I know I can probably inner join to the system tables and type tables but I'm wondering if there's a more elegant way. Note that column_value is a varchar that "could" have an int, but not necessarily. Maybe I can just cast it and trap the error? But again, that se...

Using RoR with a legacy table that uses E-A-V

I'm needing to connect to a legacy database and pull a subset of data from a table that uses the entity-attribute-value model to store a contact's information. The table looks like the following: subscriberid fieldid data 1 2 Jack 1 3 Sparrow 2 2 Dan 2 ...

Help with Supertype/Subtype? (and categories..)

I have a service table. Each service is defined by 1 main category and 1 sub category. For example, Service = Joe's Web Company, MainCategory = Information Technology, SubCategory = Web Development Each service offered will have a common set of properties (cost, location etc) Each service will also have a set of attributes specific...

Too many tables; MySQL can only use 61 tables in a join

What is the best way to export data from multiple tables in MySQL. I'm basically working with product details. Say a product has 150 attributes of data. How can I export that in a single row and then export it to a flat file in CSV or tabdelimited format. Getting error Too many tables; MySQL can only use 61 tables in a join /**** Get ...

Data Modeling for EAV

How are others using relational modeling tools to map a logical model or one in third normal form to a database that uses EAV? ...

Mysql field sizes on meta data

I want to create a table that will contain dynamic data, it can be in a form of a date, boolean or a text article for example: meta_key = "isActive" meta_valu = "1" or meta_key = "theDate" meta_value = "Sat Jul 23 02:16:57 2005" or meta_key = "description" meta_value = "this is a description and this text can go on and on so i nee...

Modify automatically an attribute with magento

I want to modify one attribute of my product automatically (code). How could i do that plz? I have seen how to show one attribute, but not how to modify. Thx ...

dynamic sql pivot table

Hi Sirs, i hope you can help me with the resolution of this task we have. originally we have these tables: hwtype id name 1 router 2 switch hwelement id idhwtype name 1 1 RTR1 2 1 RTR2 3 2 SWT1 hwattributes id idhwtype name 1 1 speed 2 1 IP 3 2 ports hwtypeattri...

(PHP & mySQL) Treat rows as columns

Hi all, I am working on PHP & mySQL based website. I am trying to setup the 'Settings' page in administration panel where I can enter different settings to manage the site. The settings can range upto 100 (or even more) depending upon the requirements. So instead of making 100 columns (and increase if I have to add more columns in future...

How does Virtuemart do EAV without using EAV?

I understand the three basic failures in EAV, namely that it takes a lot of work to reassemble the data. However, I want a database where I can add custom fields. A lot of people say that Virtuemart allows custom fields but without using an EAV database structure. Can someone explain how this can be done or provide links? ...

Please Help Me With Mysql Slow Query Analysis.

I have this mysql query that I am trying to analyze. It is very slow, the visitor table here is about 50K entries, this query never returns. When I tried an explain statement, I found out that the index is not being used on the visitor table, In spite of the index being available. Now this is the great puzzle I need help solving. Any hin...