Using @Column in EJB

Hello!

I encountered this problem. I want to change column name in mapping with @Column annotation.

@Entity
public class FooWorker implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

@Column (name = "foofoo")
private String foo;
...
}

@Column annotation is highlighted with error: "Cannot resolve symbol." and IDEA proposes to assigning PU datasource. I got assigning working ok.

persistent.xml looks like this:
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider jwt.FooWorker ]]>

I checked it in netbeans and it works ok. Why IDEA isn't ok with that?

cheers :)

2 comments
Comment actions Permalink

Hello Wiktor!

Looks like you don't have any @Table annotation for your entity,
so the column table is not known.


Wiktor Gworek wrote:

Hello!

I encountered this problem. I want to change column name in mapping with @Column annotation.

@Entity
public class FooWorker implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

@Column (name = "foofoo")
private String foo;
...
}

@Column annotation is highlighted with error: "Cannot resolve symbol." and IDEA proposes to assigning PU datasource. I got assigning working ok.

persistent.xml looks like this:
<persistence xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="JpaStandalonePU" transaction-type="RESOURCE_LOCAL">

<provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
<class>jwt.FooWorker</class>
<properties>
<property name="toplink.jdbc.url" value="jdbc:mysql://localhost/jpa"/>
<property name="toplink.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="toplink.jdbc.user" value="..."/>
<property name="toplink.jdbc.password" value="..."/>
<property name="toplink.ddl-generation" value="drop-and-create-tables"/>

<property name="com.intellij.javaee.persistence.datasource" value="mysql"/>
</properties>

</persistence-unit>
</persistence>

I checked it in netbeans and it works ok. Why IDEA isn't ok with that?

cheers :)

0
Comment actions Permalink

Hi,

Actually, I still encounter this problem.
I have tested it, Even add @Table into code. this problem still will occur.

If I ingore this error, and then execute my code, it could work fine without any mistake.
But the error information still will make me unhappy.

0

Please sign in to leave a comment.