I did turn on the logging and also added some print lines within the
HibernateConfigurationTest and found that the select * was not getting any
information back, but it's not sending me any error messages, besides saying
that the object with an existing id is not found. Any other ideas?
tibi-3 wrote:
>
> did you turn on the logging for queries?
>
> in log4j.properties (by default commented out)
>
> tibi
>
> BoJeevs wrote:
>> I am using annotations. Here is the class
>> @Entity
>> @Table(name="ORG")
>> public class Organization extends BaseObject {
>> protected String id;
>> protected String name;
>> protected String topFlag;
>>
>> /**
>> * @return String(20) the id
>> */
>> @Id
>> @Column(name="ORG_ID", length=20)
>> public String getId() {
>> return id;
>> }
>>
>> /**
>> * @return String(25) the name
>> */
>> @Column(name="ORG_NAME", length=25, nullable=false)
>> public String getName() {
>> return name;
>> }
>>
>> /**
>> * @return String(1) the topFlag
>> */
>> @Column(name="ORG_TOP_FL", length=1, nullable=false)
>> public String getTopFlag() {
>> return topFlag;
>> }
>>
>> No columns are being added to the current table now, but the test still
>> can't find the data with any of the exisiting data in the database.
>>
>> I also tried doing a getAll and it is returning null. It just seems like
>> I
>> should be getting a different error message when trying to get by id or
>> at
>> least receive some sort of error message when trying to get them all.
>>
>> Again any suggestions would be very helpful. Thanks
>>
>>
>>
>> tibi-3 wrote:
>>
>>> check your mappings closely
>>> and your database. maybe hibernate expects a column ID and there is a
>>> clomn objectID or id or some missmatch.
>>>
>>> if hibernate can't find the column it expects it will be added. so check
>>> your database on newly made columns.
>>>
>>> what happens if you do a get all object. do your objects have an id
>>> field with the value you are looking for?
>>>
>>> you will get there....
>>>
>>> tibi
>>>
>>>
>>> BoJeevs wrote:
>>>
>>>> I have removed the sample data and removed the generation of the table,
>>>> but
>>>> the GenericDaoHibernate is still having an erron the getting the id.
>>>> Again
>>>> this works fine in mysql with sample data populating the database, but
>>>> when
>>>> I moved to an already existing sql server 2005 database it started
>>>> hickuping. It has an error trying to get by id on my object. Inside
>>>> GenericDaoHibernate I am getting the "object with id " + id + " not
>>>> found"
>>>> error.
>>>>
>>>> The only thing that I can really think of is that maybe their is some
>>>> issue
>>>> is that I am only pulling three items from a table that has more than
>>>> 30
>>>> items. Again, if anyone has any suggestions, they would greatly
>>>> appreciated. Thanks for the first tip Tibi.
>>>>
>>>>
>>>>
>>>> tibi-3 wrote:
>>>>
>>>>
>>>>> yes when you have sample data as your test data your database will be
>>>>> overwritten.
>>>>> remove it and you will be fine (or don't run test/integration-tests on
>>>>> your database)
>>>>>
>>>>> ciao,
>>>>>
>>>>> tibi
>>>>>
>>>>> John Coleman wrote:
>>>>>
>>>>>
>>>>>> Fitzy?
>>>>>>
>>>>>> Coleman
>>>>>>
>>>>>> On Jul 13, 2007, at 7:56 PM, Bo Jeevs wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Hello all. I am working with a database used by a different
>>>>>>> program,
>>>>>>> but I really only want to access a few of the fields from a
>>>>>>> particular table. I believe I have it mapped correctly, but instead
>>>>>>> of using the current database, when I do the install it creates a
>>>>>>> new
>>>>>>> table with the same name and only the few fields I have added. I am
>>>>>>> using appfuse 2-M5 and have searched all over, so if anyone has any
>>>>>>> idea as to how I can accomplish this, I would be very thankful.
>>>>>>>
>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Hibernate-with-existing-database-tf4077792s2369.html#a11748803
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]